import time
def bSort(array):
    length = len(array)
    for i in range(length):
        for j in range(0, length-i-1):
            if array[j] > array[j+1]:
                temp = array[j]
                array[j] = array[j+1]
                array[j+1] = temp              
a = input()
start = time.time()
bSort(a)
end = time.time()
print((end-start) * 10**3, "milliseconds")
    
